package com.tanhua.dubbo.api;


import com.tanhua.dubbo.mapper.AnnouncementMapper;
import com.tanhua.model.domian.Announcement;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class AnnouncementApiImpl  implements  AnnouncementApi{

    @Autowired
    private AnnouncementMapper announcementMapper;

    @Override
    public List<Announcement> announcements(Integer page, Integer pagesize) {
        page = (page - 1) * pagesize;
        List<Announcement> list =  announcementMapper.findAll(page,pagesize);
        return list;
    }
}
